import java.util.Scanner;

public class riqijisuanqi {

    public static boolean chazhennian(int ay, int by, int am, int bm, int ad, int bd) {

        if (by > ay) {
            return true;
        } else {
            return false;
        }
    }

    public static boolean runnian(int y) {
        if (y % 100 != 0 && y % 4 == 0 || y % 400 == 0) {
            return true;
        } else {
            return false;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.println("请依次输入两个日期，中间用‘-’分隔（2024-3-22），计算返回两个日期相差的天数");

        String a = scanner.nextLine();
        String[] arr = a.split("-");

        int day = 0;

        String b = scanner.nextLine();
        String[] brr = b.split("-");

        int ay = Integer.parseInt(arr[0]);
        int am = Integer.parseInt(arr[1]);
        int ad = Integer.parseInt(arr[2]);
        int by = Integer.parseInt(brr[0]);
        int bm = Integer.parseInt(brr[1]);
        int bd = Integer.parseInt(brr[2]);

        if (chazhennian(ay, by, am, bm, ad, bd)) {
            for (int i = ay; i < by; i++) {
                if ((runnian(i)) && am <= 2 || runnian(i + 1) && am > 2) {
                    day += 366;
                } else {
                    day += 365;
                }
            }
        }


        int flag = 1;
        if (am > bm) {
            flag = -1;
        }
        if (am != bm) {
            switch (Math.max(am, bm)) {
                case 12: {
                    day += flag * 30;
                    if (Math.min(am, bm) == 11) {
                        break;
                    }
                }
                case 11: {
                    day += flag * 31;
                    if (Math.min(am, bm) == 10) {
                        break;
                    }
                }
                case 10: {
                    day += flag * 30;
                    if (Math.min(am, bm) == 9) {
                        break;
                    }
                }
                case 9: {
                    day += flag * 31;
                    if (Math.min(am, bm) == 8) {
                        break;
                    }
                }
                case 8: {
                    day += flag * 31;
                    if (Math.min(am, bm) == 7) {
                        break;
                    }
                }
                case 7: {
                    day += flag * 30;
                    if (Math.min(am, bm) == 6) {
                        break;
                    }
                }
                case 6: {
                    day += flag * 31;
                    if (Math.min(am, bm) == 5) {
                        break;
                    }
                }
                case 5: {
                    day += flag * 30;
                    if (Math.min(am, bm) == 4) {
                        break;
                    }
                }
                case 4: {
                    day += flag * 31;
                    if (Math.min(am, bm) == 3) {
                        break;
                    }
                }
                case 3: {
                    if (runnian(by)) {
                        day += flag * 29;
                    } else {
                        day += flag * 28;
                    }
                    if (Math.min(am, bm) == 2) {
                        break;
                    }
                }
                case 2: {
                    day += flag * 31;
                    if (Math.min(am, bm) == 1) {
                        break;
                    }
                }
            }
        }

        if (ad > bd) {
            day -= ad - bd;
        } else if (ad < bd) {
            day += bd - ad;
        }

        System.out.println(day);


    }
}

